import cookies from 'js-cookie'
import ManageConstant from "../consts/manageConstant";
import qs from "qs"

class TaskService{

  constructor(_this) {
    this._this = _this;
    this._axios = _this.axios.create({
      baseURL: ManageConstant.DOMAIN_URL,
      timeout: 5000,
      headers: {
        Token: cookies.get('Token')
      }
    });
  }

  searchTasks(params, executeMethod){
    this._axios.get(ManageConstant.TASK_SEARCH, {params}).then(res => {
      if (res.data.resultCode == 0) {
        executeMethod(this._this, res.data);
      }
    })
  }
}
export default TaskService;
